#ifndef _W_MENU_H__
#define _W_MENU_H__

class CMenu
{
public:
	struct TMenuData
	{
		UINT_PTR	ID;
		HICON		Icon;
		CMenu *		Parent;
	};
	TMenuData	_List[12];
	ULONG		_Count;
	HMENU		_Menu;

public:
	CMenu(HMENU);
	LONG Append(UINT uFlags, UINT_PTR uIDNewItem = 0, LPCWSTR lpNewItem = 0, HICON hIcon = 0, PCSTR lpNewItemA = 0);
	VOID SetDefault(UINT_PTR);
	BOOL Enable(UINT_PTR, BOOL);
	BOOL Check(UINT_PTR, BOOL);
	BOOL Track(int x, int y, HWND hWnd, UINT uFlags = TPM_RETURNCMD, CONST RECT *prcRect = 0);
	VOID Release();
};

class CMenuMan
{
private:
	VOID OnMeasure(LPMEASUREITEMSTRUCT);
	VOID OnDraw(LPDRAWITEMSTRUCT);

public:
	CMenu *	Create();
	CMenu *	Add(HMENU);
	VOID	OnMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
};

extern CMenuMan gMenu;

#endif